﻿using System;
namespace GURUCORE.Framework.Business
{
    public interface IDAUService
    {
        GURUCORE.Framework.Core.Data.DTOBase _AddObject(GURUCORE.Framework.Core.Data.DTOBase p_DTO);
        int _DeleteObject(Type p_ObjectType, int p_nObjectID);
        int _DeleteObject(GURUCORE.Framework.Core.Data.DTOBase p_oObject);
        int _DeleteObjects(Type p_ObjectType, GURUCORE.Framework.DataAccess.ORMapping.CriteriaMapping.Criteria p_oCriteria);
        object _GetAggregateValue(Type p_Type, GURUCORE.Framework.DataAccess.ORMapping.CriteriaMapping.Expression p_expTarget, GURUCORE.Framework.DataAccess.ORMapping.CriteriaMapping.Criteria p_oCriteria, GURUCORE.Framework.DataAccess.ORMapping.Aggregation p_oAggregation);
        object _GetAggregateValueForGMetaTable(Type p_Type, string p_sTableName, GURUCORE.Framework.DataAccess.ORMapping.CriteriaMapping.Expression p_expTarget, GURUCORE.Framework.DataAccess.ORMapping.CriteriaMapping.Criteria p_oCriteria, GURUCORE.Framework.DataAccess.ORMapping.Aggregation p_oAggregation);
        GURUCORE.Framework.Core.Data.GMetaDTO _GetGMetaObject(string p_sEntityName, string p_sIDFieldName, int p_nID, params string[] arrColumn);
        GURUCORE.Framework.Core.Data.GMetaDTO[] _GetGMetaObjects(string p_sObjectName, GURUCORE.Framework.DataAccess.ORMapping.CriteriaMapping.Criteria p_oCriteria, params string[] p_arrColumn);
        GURUCORE.Framework.Core.Data.GMetaDTO[] _GetGMetaObjects(string p_sObjectName, GURUCORE.Framework.DataAccess.ORMapping.CriteriaMapping.Expression p_oExpression, params string[] p_arrParam);
        GURUCORE.Framework.Core.Data.GMetaDTO[] _GetLocalizedGMetaObjects(string p_sObjectName, GURUCORE.Framework.DataAccess.ORMapping.CriteriaMapping.Expression p_oExpression, params string[] p_arrColumn);
        GURUCORE.Framework.Core.Data.GMetaDTO[] _GetLocalizedGMetaObjects(string p_sObjectName, GURUCORE.Framework.DataAccess.ORMapping.CriteriaMapping.Criteria p_oCriteria, params string[] p_arrColumn);
        GURUCORE.Framework.Core.Data.DTOBase _GetLocalizedObject(Type p_Type, string p_sKey, object p_oValue, params string[] p_arrColumn);
        GURUCORE.Framework.Core.Data.DTOBase[] _GetLocalizedObjects(Type p_Type, GURUCORE.Framework.DataAccess.ORMapping.CriteriaMapping.Expression p_oExpression, params string[] p_arrColumn);
        GURUCORE.Framework.Core.Data.DTOBase[] _GetLocalizedObjects(Type p_Type, GURUCORE.Framework.DataAccess.ORMapping.CriteriaMapping.Criteria p_oCriteria, params string[] p_arrColumn);
        GURUCORE.Framework.Core.Data.DTOBase[] _GetLocalizedObjects(Type p_Type, string p_sKey, object p_oValue, params string[] p_arrColumn);
        GURUCORE.Framework.Core.Data.DTOBase[] _GetLocalizedObjects(Type p_Type, GURUCORE.Framework.DataAccess.ORMapping.CriteriaMapping.Expression p_expCondition, string p_sOrderColumn, int p_nOrderType, int p_nPage, int p_nItemPerPage, params string[] p_arrColumn);
        GURUCORE.Framework.Core.Data.DTOBase _GetObject(Type p_ObjectType, string p_sFieldName, object p_oValue, params string[] p_arrColumn);
        GURUCORE.Framework.Core.Data.DTOBase _GetObject(Type p_ObjectType, int p_nObjectID, params string[] p_arrColumn);
        GURUCORE.Framework.Core.Data.DTOBase[] _GetObjects(Type p_Type, GURUCORE.Framework.DataAccess.ORMapping.CriteriaMapping.Criteria p_oCriteria, params string[] p_arrColumn);
        GURUCORE.Framework.Core.Data.DTOBase[] _GetObjects(Type p_Type, GURUCORE.Framework.DataAccess.ORMapping.CriteriaMapping.Expression p_oExpression, params string[] p_arrColumn);
        GURUCORE.Framework.Core.Data.DTOBase[] _GetObjects(Type p_Type, string p_sColumn, object p_Value);
        int _SaveObject(GURUCORE.Framework.Core.Data.DTOBase p_oDTO);
        int CalculatePageCount(int p_nRecordCount, int p_nRecordPerPage);
        void ChangeDataSource(string p_sModuleGUID, string p_sDSName);
        int DeleteObjects(Type p_Type, string p_sColumn, string p_Value);
        object ExecuteNonQuery(string p_sSQL, params System.Data.IDbDataParameter[] parameters);
        object ExecuteScalar(string p_sSQL, params System.Data.IDbDataParameter[] parameters);
        string GetConnectionString();

        GURUCORE.Framework.Core.Data.DTOBase[] _RunSP(GURUCORE.Framework.Core.Data.SPBase p_oSPBase, Type p_oReturnDTOType);

        System.Data.DataSet GetDataSet(string p_sSQL, params System.Data.IDbDataParameter[] parameters);
        System.Data.DataSet GetDataSetBySP(string p_sSQL, params System.Data.IDbDataParameter[] parameters);
        System.Data.DataTable GetDataTable(string p_sSQL, params System.Data.IDbDataParameter[] parameters);
        int SaveObjects(GURUCORE.Framework.Core.Data.DTOBase[] p_arrObject);

        GURUCORE.Framework.Business.DTO.ParamDTO GetSystemParam(string p_sScope,  string p_sObjectName, string p_sParamName);
        GURUCORE.Framework.Business.DTO.ParamDTO SetSystemParam(string p_sScope, string p_sObjectName, string p_sParamName, string p_sParamValue);
    }
}
